home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1996 January / macformat-033.iso / mac / Shareware City / Control Strip / ES 1.0 Package / Programming Stuff / ESDemo.c ƒ / ESDemo.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-10-30  |  3.0 KB  |  100 lines  |  [TEXT/MMCC]

  1. /* ---------------------------------------------------------------------------
  2. ESDemo.h
  3.     
  4.     ©1995 Ammon Skidmore, Skidperfect Software Inc.  All Rights Reserved.
  5. --------------------------------------------------------------------------- */
  6.  
  7. #ifndef SystemSevenOrLater
  8. #define SystemSevenOrLater 1
  9. #endif
  10.  
  11. #define rIconSuiteId        257
  12. #define rPopupMenuID        256
  13. #define rArrowPictID        256
  14. #define rMyStringsID        256
  15. #define kHelpStringIndex    1    // index of the help string
  16. #define    kIconWidth            16    // width of our icon
  17.  
  18. #define kBeepIfPPC            1
  19. #define kHiliteClicks        3
  20. #define kCustomBalloons        4
  21. #define kCheckKeyDowns        5
  22. #define kUseDragNDrop        7
  23. #define kDragFiles            8
  24. #define kDragTextClippings    9
  25. #define kSafeFinderQuit1    11
  26. #define kSafeFinderQuit2    12
  27. #define kCloseDown            14
  28.  
  29. #define    kFinderType            'FNDR'
  30. #define    kSysCreator            'MACS'
  31.  
  32. // useful macros:
  33. #define width(rect)            ((rect).right - (rect).left)    // macro for rect width
  34. #define height(rect)        ((rect).bottom - (rect).top)    // macro for rect height
  35. #define PicFrame(what)        ((**MyGlobals.what).picFrame)    // macro for picture frame rect
  36. #define pstrcpy(dst, src)    (BlockMove((src), (dst), (src)[0] + 1))
  37.  
  38. #ifndef __ICONS__
  39. #include <Icons.h>
  40. #endif  __ICONS__
  41.  
  42. #ifndef __DRAG__
  43. #include <Drag.h>
  44. #endif  __DRAG__
  45.  
  46. #ifndef __CONTROLSTRIP__
  47. #include <ControlStrip.h>
  48. #endif  __CONTROLSTRIP__
  49.  
  50. #ifndef __EXTENSIONSSTRIP__
  51. #include "ExtensionsStrip.h"
  52. #endif  __EXTENSIONSSTRIP__
  53.  
  54. // our structures:
  55. #if PRAGMA_ALIGN_SUPPORTED
  56. #pragma options align=mac68k
  57. #endif
  58.  
  59. typedef struct
  60. {
  61.     Handle                    iconSuite;
  62.     MenuRef                    myMenuH;
  63.     Handle                    myStrings;
  64.     PicHandle                myArrowPict;
  65.     Boolean                    hasExtensionsStrip;
  66.     long                    currentFeatures;
  67.     // Drag globals:
  68.     DragTrackingHandlerUPP    myTrackingUPP;
  69.     DragReceiveHandlerUPP    myReceiveUPP;
  70.     Boolean                    canAcceptDrag, hasEntered;
  71.     Boolean                    acceptFiles, acceptText;
  72.     ModuleReference            myReferenceNum;    // required only for Extensions Strip
  73.     Rect                    myBox;            // required only for Control/Desktop Strip
  74. } MyGlobals, *MyGlobalPtr, **MyGlobalHandle;
  75.  
  76. #if PRAGMA_ALIGN_SUPPORTED
  77. #pragma options align=reset
  78. #endif
  79.  
  80. // our prototypes:
  81. void sdevDraw(MyGlobalHandle myGlobals, Rect *statusRect, GrafPtr statusPort);
  82. void sdevClose(MyGlobalHandle myGlobals, WindowRef statusPort);
  83. long sdevInit(WindowRef statusPort);
  84. long sdevClick(MyGlobalHandle myGlobals, const Rect    *statusRect, WindowRef statusPort);
  85. //
  86. Boolean    HasDragMgr(void);
  87. void InstallDragHandlers(WindowRef statusPort, MyGlobalHandle myH);
  88. void RemoveDragHandlers(WindowRef statusPort, MyGlobalHandle myH);
  89. Boolean    HasExtensionsStrip(void);
  90. //
  91. OSErr FindAProcess(OSType typeToFind, OSType creatorToFind,
  92.                              ProcessSerialNumberPtr processSN,
  93.                              ProcessInfoRecPtr infoRecToFill);
  94. void QuitProcess (ProcessSerialNumber PSN, Boolean hasExtensionsStrip);
  95. void DrawMyIcon(MyGlobalHandle myGlobals, Boolean selected);
  96. pascal OSErr MyTrackingHandler(short message, WindowRef theWindow,
  97.                                     void *handlerRefCon, DragReference theDrag);
  98. pascal OSErr MyReceiveDropHandler(WindowRef theWindow, void *handlerRefCon,
  99.                                     DragReference theDrag);
  100.